
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>   
<%@taglib uri="http://www.springframework.org/tags/form" prefix="sf" %>
<!DOCTYPE html>
<html>
	<head>	
		<meta charset="utf-8" />
		<meta name="keywords" content="${bSeries.seoKeywords}">
		<meta name="description" content="${bSeries.seoDescription}">
		<title>播放${bSeries.seoTitle}</title>
		<link rel="stylesheet" href="${pageContext.request.contextPath }/resources/front/css/bootstrap.min.css" />
		<link rel="stylesheet" href="${pageContext.request.contextPath }/resources/front/css/public.css" />
		<link rel="stylesheet" href="${pageContext.request.contextPath }/resources/front/css/font-awesome.css" />
		<style type="text/css">
		.video .play .detail .jianjie .jc-ul{
			width:100%;	
		}
		.video .play .detail .jianjie .jc-ul a li{
			width:92%;
			padding: 10px 0px;
			margin-left: 5px;
			border-bottom: 1px solid #999;
		}
		.video .play .detail .jianjie .jc-ul a:last-child li{
			border-bottom: none;
		}
		.video .play .detail .jianjie .jc-ul a li .tp{
			width:35%;
			position: relative;
			margin-right: 2%;
			display: inline-block;
			vertical-align: top;
		}
		.video .play .detail .jianjie .jc-ul a li .tp img{
			width:100%;
		}
		.video .play .detail .jianjie .jc-ul a li .tp span{
			display: inline-block;
			position: absolute;
			background: rgba(0,0,0,0.5);
			color: #ffffff;
			right:0;
			bottom: 0;
			padding: 3px 4px;
			font-size:12px;
		}
		.video .play .detail .jianjie .jc-ul a li .wd{
			width:60%;
			display: inline-block;
		}
		.video .play .detail .jianjie .jc-ul a li .wd .ht{
			margin-bottom: 4px;
			color: #ffffff;
			font-size: 16px;
		}
		.video .play .detail .jianjie .jc-ul a li .wd .hword{
			font-size: 13px;
			color: #dddddd;
		}
		.jies{
			height:22px;
			width:100%;
			border-bottom: 1px solid #999;
			position: relative;
			z-index: 99;
		}
		.jies .jt{
			line-height: 20px;
			margin-left: 180px;
		}
		.jies .waic{
			width:100%;
			position: absolute;
			top:22px;
			overflow: hidden;
			background: #333333;
			padding: 15px 15px;
			display: none;
			left:-0px;
			
		}
		.jies .waic .content{
			width:109%;
			
			color: #ffffff;
				
			max-height: 380px;
			overflow: auto;
		}
		.jies .content .title{
			font-size: 16px;
			color: #DE5D4D;
		}
		.jies .content .jj-ul{
			width:97%;
		}
		.jies .content .jj-ul li{
			width:100%;
			margin-top: 10px;
			font-size: 12px;
		}
		.jies .content .jj-ul li p{
			line-height: 20px;
			text-indent:25px ;
		}
		.no-select{
			-webkit-touch-callout: none;
		    -webkit-user-select: none;
		    -khtml-user-select: none;
		    -moz-user-select: none;
		    -ms-user-select: none;
		    user-select: none;
		}
		p.content{
			min-height:68px;
		}	
		a.more{
			float:right;
		}
		</style>
	</head>
	<body>
		 
		<%@ include file="../header.jsp" %>
		<div id="allAdverti" style="display:none">
			<c:forEach items="${banner7_list}" var="item">
					${item }
			</c:forEach>
			<c:forEach items="${rect3_list}" var="item">
					${item }
			</c:forEach>
		</div>
		<div class="all-bd">
			<!--播放器-->
			<div class="video">
				<p class="p-tilte"><span>${bVideo.tag}</span>&nbsp;<span><c:out value="${bSeries.name} " /></span>&nbsp;<span>${bVideo.setNum}</span></p>
				<div class="play">
					<div class="player">
						<div id="a1"></div>
					</div>
					<div class="detail">
						<div class="jies">
							<span class="fa fa-angle-down fa-2x jt">
								<div class="waic">
									<div class='content'>
										<div class="title">
											${bVideo.tag}
										</div>
										<ul class="jj-ul">
								        	<li>类型：<span>${bSeries.typeName }</span></li>
								        	<c:if test="${youkuS eq null}">
								        	<li>导演：<span>${bSeries.director }</span></li>
								        	<li>主演：<span>${bSeries.actor }</span></li>
								        	<li>简介：${bSeries.summary }</li>
								        	</c:if>
								        </ul>
									</div>
								</div>
							</span>
							
							
						</div>
						<ul class="t-tab">
							<li class="li-xz">精彩片段</li>
							<li>剧集选择</li>
						</ul>
						<div class="jianjie">
							<div class="conter">
								<div class="conter-in">
							        <ul class="jc-ul">
							        <c:forEach items="${Marvellous}" var="list" varStatus="status">
									<a href="${pageContext.request.contextPath }/public/detail/show.html?seriesId=&setNum=&youkuId=${list.id}">
							        		<li>
												<div class="tp">
													<img src="${baseImgPath}${ list.localCoverUrl}" alt=""/>
												</div>
												<div class="wd">
													<p class="ht">${list.title }</p>	
													<p class="hword">${list.introduction }</p>													
												</div>
											</li>
							        	</a>
									</c:forEach>
							        	
							        	
									</ul>
								</div>		
							</div>
										        
					        <div class="scroll-y" id='scroll-c'>
					        	<div class="st">
					        		<div class="scroll-btn" id='scroll-ctn'></div>
					        	</div>					        	
					        </div>
						</div>
						<div class="jianjie" style="display: none;">
							<ul class="fj-ul">
							<c:forEach items="${bVideoList}" var="list" varStatus="status">
								<li><a href="${pageContext.request.contextPath }/public/detail/show.html?seriesId=${list.seriesId}&setNum=${list.setNum}&youkuId=${youkuid}" class="a-ch">${status.index+1 }</a></li>
							</c:forEach>
					        </ul>
					        <div class="scroll-y" id="scroll-d">
					        	<div class="st">
					        		<div class="scroll-btn" id="scroll-dtn"></div>
					        	</div>					        	
					        </div>
						</div>						
					</div>
				</div>
				<div class="indrr">
					<div class="gn">
						<a class="fa fa-commenting-o" aria-hidden="true" href="#"></a>
						<a class="pinglun" href="#ments"><span id="HFcounts">${c_Count}条评论</a>
						<a href="javascript:void(0);" class="fengx">分享</a>
						<div id="share" class="fengx">
								<div class="bdsharebuttonbox">
									<!-- <a href="#" class="bds_more" data-cmd="more"> --></a><a href="#"
										class="bds_qzone" data-cmd="qzone" title="分享到QQ空间"></a><a href="#"
										class="bds_tsina" data-cmd="tsina" title="分享到新浪微博"></a><a href="#"
										class="bds_weixin" data-cmd="weixin" title="分享到微信"></a>
								</div>
							</div>
						<a class="fa fa-caret-square-o-right " aria-hidden="true" href="#"></a>
						<a class="fengx" href="#">${bVideo.playCount}</a>
						<a  class="fa fa-thumbs-o-up" href="javascript:void(0);" id="dianZan" ></a>
						<a class="fengx"  id="Zan" >${bVideo.likeCount}</a>
						
					
				</div>
				
				<div class="guanggao" ></div>
			</div>
			</div>
			<!--still like-->
			<div class="enjoy">
			<c:if test="${mayLikeSeriesList.size()>0}">
				<p class="big-style">看过此片的还喜欢</p>
				<ul class="only">
				<c:forEach items="${mayLikeSeriesList}"  var='mayLikeSeries'>
					<a href="${pageContext.request.contextPath }/public/detail/show.html?seriesId=${mayLikeSeries.id}&setNum=1">	
						<li>
							<img src="${baseImgPath}${ mayLikeSeries.poster}" alt="" />
						    <p class="c-title">${mayLikeSeries.name}</p>
					        <p class="c-word">${mayLikeSeries.description}</p>
					        <span class="bj">独播</span>
						</li>
						
					</a>
					</c:forEach>
				</ul>
				</c:if>
			</div>
			<div class="advier" id="adbanner7"></div>
			<!--评论-->
			<div class="enjoy">
				<p class="big-style">评论<span class="tj">排行推荐</span></p>
				<div class="ment" id="ments">
				
					<p><span>文明上网理性发言，请遵守新闻评论服务协议</span><span class="munb">${c_Count}条评论</span></p>
				    <label id="gpt">你还可以输入<var style="color: #C00">300</var>个字符。</label>	
					<textarea class="inflow" id="in_comment" 
					 onmousedown="s(event,this)"  maxlength="300"
					  onchange="this.value=this.value.substring(0, 300)"
					   onkeydown="this.value=this.value.substring(0, 300)" 
					   onkeyup="this.value=this.value.substring(0, 300)">
					 
					</textarea>
					<p><a href="javascript:void(0);" class="fabiao" id="fabiao" onclick="">发表</a></p>
					<ul class="tab-pl">
						<li class="li-g">所有评论</li>
					</ul>
					<div id="p_detail">
						<div class="pl-detail" >
							<div class="pic">
								<img src="${pageContext.request.contextPath }/resources/front/img/3.jpg" alt="" />
							</div>
							<div class="right-sr">
								<p><span>用户名字</span><span class="timer">10m</span><span class="jb">举报</span></p>
								<p class="content">${rCommentList[0].content}</p>
								<p>
									<span class="make">赞</span>
									<span class="count">(50)</span>
									<span class="make">回复</span>
									<span class="count">(1)</span>
									<span class="make">分享</span>
								</p>
								<div class="inflow-argin">
									<input type="text" name="" value=""   maxlength='300' />
									  
									<span class="answer">回复</span>
								</div>
									<div class="pl-detail">
										<div class="pic">
											<img src="${pageContext.request.contextPath }/resources/front/img/3.jpg" alt="" class="img-s"/>
										</div>
										<div class="right-sr">
											<p><span>用户名字</span><span class="timer">10分钟前</span></p>
											<p class="content">时间大家都了解奥斯卡来得及啊开始了就打开撒角度来看撒娇的空间撒开了多久啊水利科技的历史</p>
											<p>
												<span class="make">赞</span>
												<span class="count">(50)</span>
												<span class="make">回复</span>
												<span class="count">(1)</span>
											</p>									
										</div>
									</div>
									<div class="pl-detail">
										<div class="pic">
											<img src="${pageContext.request.contextPath }/resources/front/img/3.jpg" alt="" class="img-s"/>
										</div>
										<div class="right-sr">
											<p><span>用户名字</span><span class="timer">10分钟前</span></p>
											<p class="content">时间大家都了解奥斯卡来得及啊开始了就打开撒角度来看撒娇的空间撒开了多久啊水利科技的历史</p>
											<p>
												<span class="make">赞</span>
												<span class="count">(50)</span>
												<span class="make">回复</span>
												<span class="count">(1)</span>
											</p>									
										</div>
									</div>
								
								
								<a href="#" class="more">查看更多回复</a>
							</div>
						</div>
						
					</div>
					<!-- <div class="pl-detail" id="pl_detail"></div> -->
					<!-- <div class="jz">
						<a href="javascript:void(0);" >加载更多</a>
					</div> -->
					<div class="ym" id="ymm">
					
						<!-- <div class="fy" id="pageUp">上一页</div> -->
						<ul>
							<c:forEach var="i" begin="1" end="${cPageSize}" step="1">
								<li>${i}</li>
							</c:forEach>
						</ul>
					<!-- 	<div class="fy" id="pageDown">下一页</div> -->
					</div>
				</div>
				<div class="paiming ws-one">
			    	<ul>
			    	 	
			    	<c:forEach items="${mayChannelSeriesList}"  var='list' varStatus="s" >
			    	<a href="${pageContext.request.contextPath }/public/detail/show.html?seriesId=${list.id}&setNum=1">
						<li <c:if test="${(s.index+1)==1 }">class="lione"</c:if> >
							<c:if test="${(s.index+1)==1 }">
							<span class="img-bc"><img width="230PX" height="129PX" src="${baseImgPath}${list.cover}" alt="" />
							<div class="zzc">					    					
		    				</div>
							</span>
							<span class="num number">${list_index+1 }</span>
							<span class="mcc word">${list.name }</span>
							</c:if>
						    <c:if test="${(s.index+1)!=1 }">
						    <span class="img-bc display-none"><img width="230PX" height="129PX" src="${baseImgPath}${list.cover}" alt="" />
							<div class="zzc">					    					
	    					</div>
							</span>
							<span class="num">${s.index+1 }</span>
							<span class="mcc callname">${list.name }</span>
						    </c:if>
						    <%-- <img src="${pageContext.request.contextPath }/resources/front/img/up.png" alt="" /> --%>
					         
						</li>
					   </a>
					</c:forEach>
			    	</ul>
			    	 
			    	<a href="#">
			    	    <div class="guanggao" id="adrect3">
			    	    </div>
			    	</a>			    	
			    </div>
			</div>	
	    </div>
		<%-- <%@ include file="../comment.jsp" %> --%>
	    <!--footer-->
	    <%@ include file="../footer.jsp" %>
	    <script type="text/javascript" src="${pageContext.request.contextPath }/resources/front/js/jquery-2.2.3.min.js" ></script>
	    <script type="text/javascript" src="${pageContext.request.contextPath }/resources/front/ckplayer6.8/js/offlights.js" charset="utf-8"></script>
		<script type="text/javascript" src="${pageContext.request.contextPath }/resources/front/ckplayer6.8/ckplayer/ckplayer.js" charset="utf-8"></script>
	    <script type="text/javascript" src="${pageContext.request.contextPath }/resources/front/js/jbase64.js" charset="utf-8"></script>
	    <script>
		window._bd_share_config = {
			"common" : {
				"bdSnsKey" : {},
				"bdText" : "火眼，给你更多",
				"bdMini" : "2",
				"bdMiniList" : false,
				"bdPic" : "${baseImgPath}${bVideo.poster}",
				"bdStyle" : "1",
				"bdSize" : "24"
			},
			"share" : {}
		};
		with (document)
			0[(getElementsByTagName('head')[0] || body)
					.appendChild(createElement('script')).src = 'http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='
					+ ~(-new Date() / 36e5)];
	</script>
	    <script type="text/javascript">
	    	//分享！
	    	
		  //如果你不需要某项设置，可以直接删除，注意var flashvars的最后一个值后面不能有逗号
			function loadedHandler(){
				if(CKobject.getObjectById('ckplayer_a1').getType()){//说明使用html5播放器
					//alert('播放器已加载，调用的是HTML5播放模块');
				}
				else{
					//alert('播放器已加载，调用的是Flash播放模块');
				}
				CKobject.getObjectById('ckplayer_a1').addListener("time","timeHandler");
			}
		  	var play_time=0;
		  	var startTime="";
			function timeHandler(t){
				if(parseInt(t)==0){
					var time=new Date();
					startTime=time.getFullYear()+"-"+(time.getMonth()+1)+"-"+time.getDate()+" "+time.getHours()+":"+time.getMinutes()+":"+time.getSeconds();
				}
				if(t!=undefined && t/60>=1){
					play_time=parseInt(t/60);
				}
				
			}
			//开关灯
			var box = new LightBox();
			function closelights(){//关灯
				box.Show();
				CKobject._K_('a1').style.width='1200px';
				CKobject._K_('a1').style.height='600px';
				CKobject.getObjectById('ckplayer_a1').width=1200;
				CKobject.getObjectById('ckplayer_a1').height=600;
			}
			function openlights(){//开灯
				box.Close();
				CKobject._K_('a1').style.width='820px';
				CKobject._K_('a1').style.height='461px';
				CKobject.getObjectById('ckplayer_a1').width=820;
				CKobject.getObjectById('ckplayer_a1').height=461;
			}
			function player(){
				/* 高清播放地址  */
		    	var resUrl='${bVideo.h720pUrl}';
		    	var enUrl=BASE64.encoder(resUrl);
		  		var h720pUrl='/webside-huoyan/public/detail/playVideo?res_url='+enUrl;
		  		var poster='${baseImgPath}${bVideo.cover}';
				var flashvars={
						f:h720pUrl,//视频地址
						a:'',//调用时的参数，只有当s>0的时候有效
						s:'0',//调用方式，0=普通方法（f=视频地址），1=网址形式,2=xml形式，3=swf形式(s>0时f=网址，配合a来完成对地址的组装)
						c:'0',//是否读取文本配置,0不是，1是
						//b:1,//是否允许和播放器进行交互，0=允许，1是不允许
						//deft:'标清,高清,超清',//配置文件里有，则不需要再设置
						deff:h720pUrl+'|'+h720pUrl+'|'+h720pUrl,
						x:'',//调用配置文件路径，只有在c=1时使用。默认为空调用的是ckplayer.xml
						i:poster,//初始图片地址
						d:'http://www.ckplayer.com/down/pause6.1_1.swf|http://www.ckplayer.com/down/pause6.1_2.swf',//暂停时播放的广告，swf/图片,多个用竖线隔开，图片要加链接地址，没有的时候留空就行
						u:'',//暂停时如果是图片的话，加个链接地址
						l:'http://www.ckplayer.com/down/adv6.1_1.swf|http://www.ckplayer.com/down/adv6.1_2.swf',//前置广告，swf/图片/视频，多个用竖线隔开，图片和视频要加链接地址
						r:'',//前置广告的链接地址，多个用竖线隔开，没有的留空
						t:'5|5',//视频开始前播放swf/图片时的时间，多个用竖线隔开
						y:'',//这里是使用网址形式调用广告地址时使用，前提是要设置l的值为空
						z:'http://www.ckplayer.com/down/buffer.swf',//缓冲广告，只能放一个，swf格式
						e:'8',//视频结束后的动作，0是调用js函数，1是循环播放，2是暂停播放并且不调用广告，3是调用视频推荐列表的插件，4是清除视频流并调用js功能和1差不多，5是暂停播放并且调用暂停广告
						v:'80',//默认音量，0-100之间
						p:'1',//视频默认0是暂停，1是播放，2是不加载视频
						h:'2',//播放http视频流时采用何种拖动方法，=0不使用任意拖动，=1是使用按关键帧，=2是按时间点，=3是自动判断按什么(如果视频格式是.mp4就按关键帧，.flv就按关键时间)，=4也是自动判断(只要包含字符mp4就按mp4来，只要包含字符flv就按flv来)
						q:'',//视频流拖动时参考函数，默认是start
						m:'',//让该参数为一个链接地址时，单击播放器将跳转到该地址
						o:'',//当p=2时，可以设置视频的时间，单位，秒
						w:'',//当p=2时，可以设置视频的总字节数
						g:'',//视频直接g秒开始播放
						j:'',//跳过片尾功能，j>0则从播放多少时间后跳到结束，<0则总总时间-该值的绝对值时跳到结束
						k:'32|63',//提示点时间，如 30|60鼠标经过进度栏30秒，60秒会提示n指定的相应的文字
						n:'这是提示点的功能，如果不需要删除k和n的值|提示点测试60秒',//提示点文字，跟k配合使用，如 提示点1|提示点2
						wh:'1080:720',//宽高比，可以自己定义视频的宽高或宽高比如：wh:'4:3',或wh:'1080:720'
						lv:'0',//是否是直播流，=1则锁定进度栏
						loaded:'loadedHandler',//当播放器加载完成后发送该js函数loaded
						//调用播放器的所有参数列表结束
						//以下为自定义的播放器参数用来在插件里引用的
						my_title:'演示视频标题文字',
						my_url:encodeURIComponent(window.location.href)//本页面地址
						//调用自定义播放器参数结束
						};
				var params={bgcolor:'#FFF',allowFullScreen:true,allowScriptAccess:'always',wmode:'transparent'};//这里定义播放器的其它参数如背景色（跟flashvars中的b不同），是否支持全屏，是否支持交互
				var video=[h720pUrl];
				CKobject.embed('${pageContext.request.contextPath }/resources/front/ckplayer6.8/ckplayer/ckplayer.swf','a1','ckplayer_a1','820','461',false,flashvars,video,params);
			}
			$(document).ready(function($) {
				var time=new Date();
				loginTime=time.getFullYear()+"-"+(time.getMonth()+1)+"-"+time.getDate()+" "+time.getHours()+":"+time.getMinutes()+":"+time.getSeconds();
				var youkuS="${youkuS}";
				if(youkuS.trim()!=""){
					$("#a1").css({width:"820px",height:"461px"});
					$("#a1").html("<object type='application/x-shockwave-flash' data='http://static.youku.com/v20161108.0/v/swf/loader.swf' width='100%' height='100%' id='movie_player' ><param name='allowFullScreen' value='true'><param name='allowscriptaccess' value='always'><param name='allowFullScreenInteractive' value='true'><param name='flashvars' value='VideoIDS="+youkuS+"&amp;isAutoPlay=true'><div class='player_html5'><div class='picture' style='height:100%'><div style='line-height:460px;'><span style='font-size:18px'>您还没有安装flash播放器,请点击<a href='http://www.adobe.com/go/getflash' target='_blank'>这里</a>安装</span></div></div></div></object>");
				}else{
					player();//加载播放器
				}
				function checkLength(target) {
					var maxLength = 300; // 这是允许输入的最大数
				        var targetLength = computeLength(target, maxLength, 2); // 这个是已输入的字符
					var leftLength =maxLength - targetLength;
				        document.getElementById("size").innerHTML = leftLength; // 这里的size就是需要变换数字地方的Id
				    }
				$(function(){  
				
				    //简介还是剧集选择
				    change();
				    function change(){
				    	var tag=window.location.hash;
				    	if(tag=="#c_2"){
				    		$("#jianjie").show();
				    		$("#juji").hide();
				    	}
				    }
				    //电影和电视剧的切换
				    var channelType=$(".Bchannel").text();
				    if(channelType.indexOf("MOVIE")==0){
				    	$(".li-jjxz").hide();
				    	//$(".title").hide();
				    } 
				    
				    //播放集数改变样式
				    $('#series_'+setNum).addClass("a-ch");
				    //评论加载
				    showComment();
				    //加载更多父级评论
				  /*$(".jz a").click(function(){
			    		 pageNo+=1;
				    	 if(pageNo+1>0){
			        		 pl_detail=$("#p_detail").html();	
			        		 showComment();
			        	 }
				    }); */
					//分页控件
					//上一页
					$("#pageUp").click(function(){
						if(pageNo>0){
							pageNo-=1;
							showPageColor();
						}
						showComment();
					});
				    //下一页
					$("#pageDown").click(function(){
						if(pageNo<pageSize-1){
							pageNo+=1;
							showPageColor();
						}
						showComment();
					});
					showPageColor();
				    //显示页数颜色
				   	function showPageColor(){
				    	$("#ymm ul li:eq("+pageNo+")").css('color','#DE5D4D');
				    	for(var i=0;i<pageSize+1;i++){
				 			if(i!=pageNo){
				 				$("#ymm ul li:eq("+i+")").css('color','#333');
				 			}
				 		}
				    	/* $("#ymm ul li:eq("+2+")").css('color','#333'); */
				    }
				    //点击到页数
				 	$(".ym ul li").click(function(){
				 		pageNo=this.innerText-1;
				 		showPageColor();
				 		showComment();
				 	});
			    });
			});
			window.onunload=function (){
				insertMongoRecord();
				}
			function insertMongoRecord(){
				var params={};
	    		params["seriesId"]="${bSeries.id}";
	    		params["seriesName"]="${bSeries.name}";
	    		params["seriesTypeName"]="${bSeries.typeName}";
	    		params["seriesTypeCode"]="${bSeries.type}";
	    		params["seriesKindName"]="${bSeries.kindName}";
	    		params["seriesKindCode"]="${bSeries.kind}";	
	    		params["channelCode"]="${bSeries.channel}";	
	    		params["playDuration"]=play_time;	
	    		if(params["channelCode"]=="MOVIE"){
	    			params["channelName"]="电影";	
	    		}else if(params["channelCode"]=="TVPLAY"){
	    			params["channelName"]="电视剧";	
	    		}else if(params["channelCode"]=="INFORMATION"){
	    			params["channelName"]="资讯";	
	    		}
	    		params["browerTime"]=loginTime;
	    		$.ajax({
	    			type:"post",
	    			async: false,
	    			data:params,
	    			url:"${pageContext.request.contextPath }/public/detail/addRecord.html",
	    			
	    		});
			}
	    
	    
	   		 /* 播放集数参数  */
	   		 var setNum="${bVideo.setNum}";
	    	/* 父级评论区域的html代码 */
	    	var pl_detail="";
	    	/* 子级评论区域的html代码 */
	    	var pl_detail_1="";
	    	/* 父级评论区域查询参数  */
	    	var pageNo = 0;
	    	/* 子级评论区域查询参数  */
	    	var pageNo_1=0;
	    	
	    	/* 评论区域页数参数  */
	    	var pageSize="${cPageSize}";
	    	var CommentId=0;
	    	var likeCookie = "${like}";//点赞cookie
			//tab
			$('.fj-ul .sure a').click(function(){
				$('.fj-ul li a').removeClass('a-ch');
				$(this).addClass('a-ch');
			})
			//tab-简介
			$('.t-tab li').each(function(index){
				$(this).click(function(){
					$(this).addClass('li-xz').siblings().removeClass('li-xz');
					$('.jianjie').eq(index).css({'display':'block'}).siblings('.jianjie').css({'display':'none'});
				})				
			})
			$('.only li').each(function(index){
				index=(index+1)*5-1;
				$('.only li').eq(index).addClass('li-none');
			})
			//滚动条
			
			//选择播放剧集
		function showEpisode(){
				var sList = new Arry($bVideoList);
				for(var i=0;i<sList.length;i++){
					if(sList[i].id==null){
						
					}
				}
			} 
			//alert("${bSeries.id}");
			 //评论加载
			    function showComment(){
				 	var vId='${bVideo.id}';
				 	var youkuS="${youkuS}";
				 	var videoFromWebId=0;
				 	if(youkuS.trim()!=""){
				 		videoFromWebId='${bSeries.id}';
				 	}
			    	$.ajax({  
				    	 type: "POST",
			             url:"${pageContext.request.contextPath }/comment/getParentComments", 
			           	 data: {pageNo:pageNo,videoFromWebId:videoFromWebId},
			             dataType: "json",  
			             timeout: 1000,  
			             cache: false,  
			             error: errorFunction,  //错误执行方法    
			             success: succFunction //成功执行方法    
			         });
			    }
			    
			 /*    function LoadFunction(data) {  
		             console.log(data);  
		         }   */
		         function errorFunction() {  
		        	 alert("无法加载评论");
		         }  
		         function succFunction(data) {  
		        	 var json=eval(data);
		        	 var htmls="";
		      
		        	 
		        	 $.each(json, function (index, item) {  
		                 //循环获取数据    
		                 var content = json[index].content;
		                 var create_time = json[index].createTime;
		                CommentId = json[index].id;
		                 var count=json[index].childrenCount;
		                 var ip=json[index].ipcode;
		                 if(count===null)count=0 ;
		                 var plDetailStr="<div class='pl-detail' id='parent_"+CommentId+"'>";
		                 plDetailStr+="<div class='pic'><img src='${pageContext.request.contextPath }/resources/front/img/3.jpg' alt='' /></div>";
		                 plDetailStr+="<div class='right-sr rightRP'>";
		                 plDetailStr+="<p><span>匿名用户-->ip:"+ip+"</span><span class='timer'>发布时间："+create_time+"</span><span class='jb'>举报</span></p>";
		                 plDetailStr+="<p class='content'>"+content+"</p>";
		                 plDetailStr+="<p><span class='make' onclick='showHF("+CommentId+")'>回复(<small class='ccount' names='"+CommentId+"' id='count_"+CommentId+"'>"+count+"</small>)</span><span class='count'></span></p>";
		                 plDetailStr+="<div class='shf' id='shf_"+CommentId+"'><div class='inflow-argin' id='THF_"+CommentId+"' style='display:none;'><input type='text' maxlength='300'  name='' id='huiFu_"+CommentId+"'/><span class='answer'  id='answer_"+index+"_"+CommentId+"' onclick='huiFu("+CommentId+")'>回复</span></div><span id='gptu_"+CommentId+"' style='display:none'>你还可以输入<i id='wcount"+CommentId+"' style='color: #C00'>300</i>个字符</span></div>";
		                 plDetailStr+="<div id='s_more_"+CommentId+"'></div><div class='so'><a href='javascript:void(0);'class='more' id='seeReply_"+CommentId+"' onclick='clickSeeMoreReply("+CommentId+")'>查看回复</a></div></div></div>";
		    			 htmls+=plDetailStr;
		             });
		        	 if(json.length==0 & pageNo==0){
		        		var msg="尚未评论";
		        		$("#ymm").css("visibility", "hidden");
		        	 }else if(typeof(msg)=="undefined"){
		        		 var msg="";
		        	 }
		        	 $("#p_detail").html(pl_detail+htmls+"<div class='pl-detail' style='border:0px;'><p>"+msg+"</p></div>");
		        	 var showHFBT=[];
		        	 showHFBT=$(".ccount");
		        	 for(var i=0;i<showHFBT.length;i++){
		        		 if(showHFBT.eq(i).text()=="0"){
		        			var commentID=showHFBT.eq(i).attr("names");
		        			$("#seeReply_"+commentID).hide();
		        		 }
		        	 }
		        	 pageNo+=1;
		         } 
			
			//加载更多子级回复评论
			 function seeMoreReplyComments(Id){
				if(CommentId != Id){
					pageNo_1 = 0;
				}
				  CommentId =Id;
				 var vId='${bVideo.id}';
		    	$.ajax({  
			    	 type: "POST",
		             url:"${pageContext.request.contextPath }/comment/getChildrenComments",
		             async:false,
		           	 data: {pageNo:pageNo_1,parentId:Id,},
		             dataType: "json",  
		             timeout: 1000,  
		             cache: false,        
		             error: errorsFunction,  //错误执行方法 
		             success: successFunction //成功执行方法    
		         });
		    	//alert(data);
			 }
			function errorsFunction(){
				alert("无法加载回复");
				$('#s_more_'+CommentId).html("加载错误"); 
			}
			var finis = false;
			//回调函数，加载子集评论
			 function successFunction(data) { 
				 finis=false;
				 var stop = false;
	        	 if(data=="尚未回复评论"){
						$('#s_more_'+CommentId).html("尚未回复评论"); 
						stop = true;
					}
	        	 if(data=="加载完毕" & finis ==false){
						$('#s_more_'+CommentId).html(pl_detail_1+"<p>所有回复加载完毕</p>"); 
						stop = true;
						finis = true;
						$('#seeReply_'+CommentId).remove();
					}
		        if(stop){
		        	return false;
		        }
	        	 var json=eval(data);
	        	 var html="";
		       
		        var parentId=json[0].parentId;
	        	 $.each(json, function (index, item) {  
	                 //循环获取数据    
	                 var content = json[index].content;
	                 var user = json[index].userId;
	                 var create_time = json[index].createTime;
	                 var plDetailStr="<div class='pl-detail'>";
	                 plDetailStr+="<div class='pic'><img src='${pageContext.request.contextPath }/resources/front/img/3.jpg' alt='' /></div>";
	                 plDetailStr+="<div class='right-sr'><p>";
	                 if(user==null){
	                	 plDetailStr+="<span>匿名用户</span>";
	                 }
	                 plDetailStr+="<span class='timer'>发布时间："+create_time+"</span><span class='jb'>举报</span></p>";
	                 plDetailStr+="<p class='contentRP'>"+content+"</p>";
	                 plDetailStr+="<p>";
	                 plDetailStr+="</p></div></div>"; 
					html+=plDetailStr;
	             
	             });
	        	 $('#s_more_'+parentId).html(pl_detail_1+html);  
	        	/*  hideBQ(parentId); */
	         }
			//加载更多子集评论;
			 function clickSeeMoreReply(CommentId){
		    	 if(pageNo_1+1>0){
	        		 pl_detail_1=$('#s_more_'+CommentId).html();	
	        		 seeMoreReplyComments(CommentId);
	        	 }
		    	 pageNo_1+=1;
		    }
			 
			 //字符串去首尾空格
			 String.prototype.trim=function() {

				    return this.replace(/(^\s*)|(\s*$)/g,'');
				}
			//发表评论
			$("#fabiao").click(function(){
				$.get('http://ipinfo.io/json', function(data) {
					var json = eval(data);
					ipCode = json.ip;
				var youkuS="${youkuS}";
				var id=0;
				if(youkuS.trim()==""){
				id= '${bVideo.id}';
				}else{
				id="${bSeries.id}";	
				}

				var text = document.getElementById("in_comment").value;
				if(text.trim()!=""){
					$.get("${pageContext.request.contextPath }/comment/insertComment?type=2&videoFromWebId="+id+"&parentId="+0+"&content="+encodeURI(encodeURI(text))+"&childrenCount=null&ipCode="
							+ ipCode,function(data){
					pageNo=0;
					$("#in_comment").val("");
				 	showComment();
				 	updatePg();
					});
				}
				var $hfcount=$("#HFcounts").text();
				var counts=parseInt($hfcount)+1;
				$("#HFcounts").text(counts+"条评论");
				$(".munb").text(counts+"条评论");
				});
			});
			//发表回复后更新页码
			function updatePg(){
				$.get(
						"${pageContext.request.contextPath }/comment/pageCount?videoFromWebId=${bSeries.id}",
						function(data){
							/* if($(".ym ul li")!=null){
								$(".ym ul li").remove();
							} */
							var html = "";
							/* for(var i = 0 ;i<data ;i++){
								html+="<li>"+(i+1)+"</li>"
							} */
							if($(".ym ul li").length<data){
								/* html+="<li>"+data+"</li>" */
								//$(".ym ul").append(html);
								location.reload();
							}
							//alert($(".ym ul li").length);
						}
					);
				
			}
			function showPageColor(){
		    	$("#ymm ul li:eq("+pageNo+")").css('color','#DE5D4D');
		    	for(var i=0;i<pageSize+1;i++){
		 			if(i!=pageNo){
		 				$("#ymm ul li:eq("+i+")").css('color','#333');
		 			}
		 		}
		    	/* $("#ymm ul li:eq("+2+")").css('color','#333'); */
		    }
			//发表回复
			function huiFu(CommentId){
				$.get('http://ipinfo.io/json', function(data) {
					var json = eval(data);
					ipCode = json.ip;
					var id= '${bVideo.id}';
					var text1 = document.getElementById("huiFu_"+CommentId).value;
					if(text1.trim()!=""){
					var count=$("#count_"+CommentId);
					if(count.text()==="0"){
						count.html(1);count="0";
					}else{
						count=count.text();$("#count_"+CommentId).html(count-1+2);}
						$.get("${pageContext.request.contextPath }/comment/insertComment?type=2&videoId="+id+"&parentId="+CommentId+"&content="+encodeURI(encodeURI(text1))+"&childrenCount="+count+"&ipCode="
							+ ipCode,function(data){
							pageNo_1=0;
							$("#huiFu_"+CommentId).val("");
							$("#seeReply_"+CommentId).css("display", "block");
							//seeMoreReplyComments(CommentId);
							hideHF(CommentId);
							});
					}
				});
				 //location.replace(location.href);
			}
			function hideHF(CommentId){
				var THF=$("#THF_"+CommentId);
				var gptu=$("#gptu_"+CommentId);
				if(THF.css("display")=="block")THF.css("display","none");
				if(gptu.css("display")=="inline-block")gptu.css("display","none");
				THF={}
				gptu={}
			}
				//输标拖动	
				//控制简介
			//判断cookie
			
			if(likeCookie == "likeIt"){
				$("#dianZan").attr("class","fa fa-thumbs-up");
				$("#Zan").css({color:"red", "font-weight":"600"});
			}
				//赞
			$("#dianZan").one('click',function(){
				if(likeCookie != "likeIt"){
				$(this).attr("class","fa fa-thumbs-up");
				$("#Zan").css({color:"red", "font-weight":"600"});
				var id= "${bVideo.id}";
				var youkuS="${youkuS}";
				var url="";
				if(youkuS.trim()!=""){
					url="likeCount.html?videoId="+id+"&youkuId=${bSeries.id}";
				}else{
					url="likeCount.html?videoId="+id+"&youkuId=";
				}
				$.get(url,function(data){
					var like=eval(data);
					$("#Zan").text(like);
				});
			}
			});
			$("textarea").val("");
			var counter = $("textarea").val().length; //获取文本域的字符串长度
			$("#gpt var").text(300 - counter);
			$(document).keyup(function() {
			    var text = $("textarea").val();
			    var counter = text.length;
			    $("#gpt var").text(300 - counter);    //每次减去字符长度
			});
			//显示输入多少个字符
            var counter = $(".inflow-argin input").val().length; //获取文本域的字符串长度
            var textHF={};
			var hf={};
            $("#gptu var").text(300 - counter);
 
            $(document).keyup(function() {
                var text = $(".inflow-argin input").val();
                var counter = text.length;
                $("#gptu var").text(300 - counter);    //每次减去字符长度
                if(textHF.is(":focus")){
                	var counter=textHF.val();
                	hf.html(300-counter.length);
                	
                }
            });
            
          //置光标在第一行第一个字符，并且光标不能通过鼠标来点击出现的位置
            function s(e,a)
            {
            	 if ( e && e.preventDefault )
                        e.preventDefault();
            	else 
            	window.event.returnValue=false;
            		a.focus();
            		
            }
			//点击回复显示 点击其他地方隐藏
			  function showHF(CommentId){
				 var THF=$("#THF_"+CommentId);
				 var GB=0;
				 var gptu=$("#gptu_"+CommentId);
				 var answer=$("#answer_"+CommentId);
				 hf=$("#wcount"+CommentId);
				 textHF=$("#huiFu_"+CommentId);
				if(THF.css("display")=="none")THF.css("display","block");
				if(gptu.css("display")=="none")gptu.css("display","inline-block");
				textHF.focus();
				$(".answer").hover(function(){
					$(this).css({background:"#ED7500",color:"#fff"});
				},function(){
					$(this).css({background:"#fff",color:"#ED7500"});
				});
			 }
			  window.onload = function(){ 
				  var fjHeight=Math.ceil($('.fj-ul li').length/5)*52,				    
				    bl=380/fjHeight*$('#scroll-d').height(),
				    pp=380-bl;				    
				if(Math.ceil($('.fj-ul li').length/5)*52<=380){
					$('#scroll-dtn').height(0); 
				}else{
					$('#scroll-dtn').height(bl);					
					$('.fj-ul').scroll(function(){
						var scrollHeight=$('.fj-ul').scrollTop(),
				            scrollBl=scrollHeight/fjHeight*$('#scroll-d').height();
						$('#scroll-dtn').animate({'top':scrollBl},10)
					})
				}
			//				
				$(function(){  
				var _move=false;//移动标记  
				var _x,_y;//鼠标离控件左上角的相对位置  
				    $("#scroll-dtn").mousedown(function(e){  
				        _move=true;  
				        _x=e.pageX-parseInt($("#scroll-dtn").css("left"));  
				        _y=e.pageY-parseInt($("#scroll-dtn").css("top"));  
				        $('body').addClass('no-select');
				    });  
				    $(document).mousemove(function(e){  
				        if(_move){  
				            var x=e.pageX-_x;//移动时根据鼠标位置计算控件左上角的绝对位置  
				            var y=e.pageY-_y;
				            if(y>=0&&y<=pp){
				            	var oo=y/380*fjHeight;
				            	$("#scroll-dtn").css({top:y});
				            	$('.fj-ul').scrollTop(oo)//控件新位置
				            }				           
				        }  
				    }).mouseup(function(){  
				    	$('body').removeClass('no-select');
				    _move=false;  			   
				    });  
			    });
			    //
			    var jjHeight=$('.conter-in').height(),				    
				    blx=380/jjHeight*$('#scroll-c').height(),
				    ppx=380-blx;				    
				if($('.conter-in').height()<=380){
					$('#scroll-ctn').height(0); 
				}else{
					$('#scroll-ctn').height(blx);					
					$('.conter').scroll(function(){
						var scrollHeightx=$('.conter').scrollTop(),
				            scrollBlx=scrollHeightx/jjHeight*$('#scroll-c').height();
						$('#scroll-ctn').animate({'top':scrollBlx},10)
					})
				}
					//				
				$(function(){  
				var _move=false;//移动标记  
				var _x,_y;//鼠标离控件左上角的相对位置  
				    $("#scroll-ctn").mousedown(function(e){  
				        _move=true;  
				        _x=e.pageX-parseInt($("#scroll-ctn").css("left"));  
				        _y=e.pageY-parseInt($("#scroll-ctn").css("top"));  
				        $('body').addClass('no-select');
				    });  
				    $(document).mousemove(function(e){  
				        if(_move){  
				            var x=e.pageX-_x;//移动时根据鼠标位置计算控件左上角的绝对位置  
				            var y=e.pageY-_y;
				            if(y>=0&&y<=ppx){
				            	var oox=y/380*jjHeight;
				            	$("#scroll-ctn").css({top:y});
				            	$('.conter').scrollTop(oox)//控件新位置
				            }				           
				        }  
				    }).mouseup(function(){  
				    _move=false;  		
				    $('body').removeClass('no-select');
				    });  
			    });
				  };
				  
				  function adLoopTime(obj){
				    	var banner1=$("."+obj);
						var length=banner1.length;
						if(banner1.eq(0).attr("status")=='null' || banner1.eq(0).attr("status")=='none' || length==0){
							$("#ad"+obj).css("display","none");
						}else{
							var interval=banner1.eq(0).attr("interval");
							if(length==1){
							var src=banner1.eq(0).find("img").attr("src");
							var basepath="${baseImgPath}";
							banner1.eq(0).find("img").attr("src",basepath+src);
							$("#ad"+obj).html(banner1.eq(0).prop("outerHTML"));
							banner1.eq(0).find("img").attr("count",interval);
							var i=0;
							setInterval(function(){ 
								if(i%interval==0){
				    				var count=banner1.eq(0).find("img").attr("count");
				    				banner1.eq(0).find("img").attr("count",parseInt(count)+parseInt(interval));
				    			}
								i++
								if(i%300==0){
									adTimeInsert(banner1.eq(0).find("img"));
									banner1.eq(0).find("img").attr("count","0");
								}
							},1000);
							}else if(length>1){
								var i=0;
								var j=0;
								var basepath="${baseImgPath}";
								var src=banner1.eq(j%length).find("img").attr("src");
								banner1.eq(j%length).find("img").attr("src",basepath+src);
								$("#ad"+obj).html(banner1.eq(j%length).prop("outerHTML"));
								banner1.eq(0).find("img").attr("count",interval);
				        		setInterval(function(){
				        			if(i<length && i!=0){
					        			var src=banner1.eq(i%length).find("img").attr("src");
					        			src=banner1.eq(i%length).find("img").attr("src");
					        			banner1.eq(i%length).find("img").attr("src",basepath+src);
					        			
					        			}
				        			i++;
				        			if(i%interval==0){
				        				j++
				        				var count=banner1.eq(j%length).find("img").attr("count");
				        				banner1.eq(j%length).find("img").attr("count",parseInt(count)+parseInt(interval));
				        				$("#ad"+obj).html(banner1.eq(j%length).prop("outerHTML"));
				        			}
									if(i%300==0){
				        				for(var t=0;t<banner1.length;t++){
				        					adTimeInsert(banner1.eq(t).find("img"));
				        					banner1.eq(t).find("img").attr("count","0");
				        				}
										
									} 
									
									
				        		},1000);
				        		
				        	}
						}
				    }
				  
				    
				  
				   
				    function adTimeInsert(obj){
				    	var $this=$(obj);
				    	var params={};
				    	params["adpositionCode"]=$this.attr("pcode");
				    	params["adpositionName"]=$this.attr("pname");
				    	params["adResourceId"]=$this.attr("adid");
				    	params["adResourceTitle"]=$this.attr("adtitle");
				    	params["adTypeName"]=$this.attr("adtypename");
				    	params["adTypeCode"]=$this.attr("adtype");
				    	params["type"]="b";
				    	params["count"]=$this.attr("count");
				    	$.ajax({
							type:"post",
							async: false,
							data:params,
							url:"${pageContext.request.contextPath }/public/addAdRecord.html",
							
						});
				    }
				    function wordsinsert(obj){
				    	var $this=$(obj);
				    	var params={};
				    	params["adpositionCode"]=$this.attr("pcode");
				    	params["adpositionName"]=$this.attr("pname");
				    	params["adResourceId"]=$this.attr("adid");
				    	params["adResourceTitle"]=$this.attr("adtitle");
				    	params["adTypeName"]=$this.attr("adtypename");
				    	params["adTypeCode"]=$this.attr("adtype");
				    	params["type"]="d";
				    	params["count"]="1";
				    	$.ajax({
							type:"post",
							async: false,
							data:params,
							url:"${pageContext.request.contextPath }/public/addAdRecord.html",
							
						});
				    }
				    $('.ws-one ul li').each(function(index){
						$(this).mouseover(function(){
							$('.ws-one ul li').removeClass('lione');
							$(this).addClass('lione');
							$(this).parent().siblings().find('.img-bc').addClass('display-none');
							$(this).children('.img-bc').removeClass('display-none');
							$(this).parent().siblings().find('.num').removeClass('number');
							$(this).children('.num').addClass('number');
							$(this).parent().siblings().find('.mcc').removeClass('word').addClass('callname');
							$(this).children('.mcc').addClass('word');
							$(this).parent().siblings().find('.sjj').removeClass('jt');
							$(this).children('.sjj').addClass('jt');
						})
					});
				    $("#adrect3").ready(function(){
				 			adLoopTime("rect3");
				        });
					  $("#adbanner7").ready(function(){
				 			adLoopTime("banner7");
				        });
					   //hover简介
					    $('.jies ').hover(function(){
					    	$('.jies .waic').stop(true,false).slideDown(500);
					    	$('.jies .jt').removeClass('fa-angle-down').addClass('fa-angle-up');
					    },function(){
					    	$('.jies .waic').stop(true,false).slideUp(500);
					    	$('.jies .jt').removeClass('fa-angle-up').addClass('fa-angle-down');
					    })
					
	    </script>
	   
	</body>
</html>
